package boardgamer.yavalath.client;

import boardgamer.yavalath.client.resources.FontHandler;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * Used to pass objects to the library.
 *
 * @author garysoed
 */
public class SharedObjects {

  private static SharedObjects INSTANCE = null;

  public static void initialize(FontHandler fontHandler, ProFeatures proFeatures) {
    INSTANCE = new SharedObjects(fontHandler, proFeatures);
  }

  public static SharedObjects instance() {
    return INSTANCE;
  }

  private final FontHandler fontHandler;
  private final ProFeatures proFeatures;

  public SharedObjects(FontHandler fontHandler, ProFeatures proFeatures) {
    this.fontHandler = checkNotNull(fontHandler, "fontHandler");
    this.proFeatures = checkNotNull(proFeatures, "proFeatures");
  }

  public FontHandler getFontHandler() {
    return fontHandler;
  }

  public ProFeatures getProFeatures() {
    return proFeatures;
  }
}
